package com.cqupt.scanning;

import cn.hutool.core.bean.BeanUtil;
import lombok.Data;
import lombok.ToString;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.BeanUtils;

import java.io.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @Date: 2021/9/9 19:17
 * @Author: 宋宝梁
 */
public class TS {

    public static void main(String[] args) throws IOException {
        Map<String, String> map = new HashMap<>();
        map.put("name", "jay");
        map.put("sex", "male");
        map.put("phone","1776552");
        map.put("email","2206156");

        Person person = new Person();
//        BeanUtils.copyProperties(map, person);
        BeanUtil.copyProperties(map, person, false);

        System.out.println(person);
    }

}

@Data
@ToString
class Person {
    private String name;
    private String sex;
    private String email;

}